<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生管理</title>
    <script src="/js/jquery.js"></script>
    <script src="/js/myAjax.js"></script>
    <link rel="stylesheet" href="/css/select-info.css">
    <link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>
<table class="table_manage">
    <caption></caption>
    <thead>
    <tr>
        <th>用户ID</th>
        <th>用户名</th>
        <th>登录ip地址</th>
        <th>登录时间</th>
    </tr>
    </thead>
    <tbody id="findAll">

    </tbody>
</table>
<div id="page" style="line-height: 50px;">
    分页
</div>
</body>
<script>
    $("#page").load('/html/page.html');
    function findAll() {
        let data={
            username:localStorage.getItem("username"),
            time:$("#time").val(),
            pageNum: $.trim($("#pageNum").val()),
            pageSize: $.trim($("#pageSize").val())
        }
        let result = myAjax('/es/getEsLog','post',data);
        console.log(result);
        if (result.code===200){
            show(result.data.list);
            $("#pageCount").html(result.data.number);
        }
    }
    function show(data) {
     let html = "";
     for(let i = 0;i<data.length;i++){
         html+='<tr>' +
             '<td>'+data[i].userId+'</td>' +
             '<td>'+data[i].username+'</td>' +
             '<td>'+data[i].ip+'</td>' +
             '<td>'+data[i].time+'</td>' +
             '</tr>'
     }
     $("#findAll").html(html);
    }
</script>
</html>